function test() {
    console.log('999999999')
}

export function buildSetterForm() {
    return [
        {
            group: "ColumnGroup",
            items: [
                {
                    component: "Input",
                    label: "车牌号",
                    name: "carNo",
                    placeholder: "没有校验的",
                },
                {
                    component:"DatePicker",
                    label:"时间",
                    name:"time",
                    type:"datetime",
                    placeholder:"请选择时间段"
                },
            ]
        },
        {
            group: "ColumnGroup",
            // cols:[10,10],
            items: [
                {
                    label: "报警来源报警来源",
                    name: "source",
                    useDetail: true,
                    component: "Select",
                    placeholder: "请选择报警来源",
                    clearable: false,
                    fetchData: {
                        type: "js",
                        expression: `_fetchAlarmSource`
                    },
                    // dataSource:[],
                    onChange: {
                        type: "js",
                        expression: `function(){
                            field.setValue("id",undefined);
                            (${test})()
                        }
                        `
                        // expression: `${test}`
                    }
                },
                {
                    label: "报警项",
                    name: "id",
                    component: "Select",
                    placeholder: "请选择报警项",
                    cacheForUpdate: {
                        type: "js",
                        expression: `props.source`
                    },
                    fetchData: {
                        type: "js",
                        expression: `function(){
                            return _fetchAlarmItem({source:props.source})
                        }`
                    }
                },
            ]
        },
        {
            group: "ColumnGroup",
            cols: [8],
            items: [
                {
                    component: "Input",
                    label: "组织",
                    name: "deptName",
                },
                {
                    component: "Input",
                    label: "车牌号",
                    name: "carNo",
                    rules: [{ required: true, message: "联系电话不能为空", trigger: "change" }]
                },
                {
                    component: "Input",
                    label: "组织",
                    name: "deptName",
                },
            ]
        },
        {
            group: "ColumnGroup",
            items: [
                {
                    component: "Select",
                    label: "职位",
                    name: "work",
                    useDetail: true,
                    multiple: true,
                    // initialVal:[{label:"工程师",value:2}],
                    // fetchData:()=>{
                    //     return new Promise((resolve)=>{
                    //         setTimeout(()=>{
                    //             resolve([{ label: "工程师", value: 1 }, { label: "设计师", value: 2 }])
                    //         },2000)
                    //     })
                    // }
                    dataSource: [{
                        label: "工程师",
                        value: 1,
                        build: function () { console.log('111111111') }
                    },
                    {
                        label: "设计师",
                        value: 2
                    }],
                },
                {
                    component: "Input",
                    label: "组织",
                    name: "deptName",
                },
                {
                    component: "Input",
                    label: "车牌号",
                    name: "carNo",
                    rules: [{ required: true, message: "联系电话不能为空", trigger: "change" }]
                },
                {
                    component: "Input",
                    label: "组织",
                    name: "deptName",
                },
            ]
        },
        {
            group: "ColumnGroup",
            cols: [12],
            items: [
                {
                    component: "Input",
                    label: "手机号",
                    name: "carVin",
                    type: "phone",
                },
            ]
        },
        {
            group: "ColumnGroup",
            cols: [8],
            items: [
                {
                    component: "Input",
                    label: "数据号",
                    display: "inline",
                    name: "dataNo",
                    type: "number",
                    unit: "km",
                    clearable: false,
                    onChange: {
                        type: "js",
                        expression: `
                            function(value){
                                console.log(value)
                            }
                        `
                    }
                },
                {
                    component:"GroupContainer",
                    items:[
                        {
                            component: "Button",
                            btnText: "查询",
                            display: "inline",
                            type: "primary",
                            icon: "el-icon-search",
                            size: "mini",
                            onClick: {
                                type: "js",
                                expression: `function(){
                            return field.getValues().then(values=>{
                                return values && _searchFormSubmit(values)
                            })
                        }`
                            }
                        },
                        {
                            component: "Button",
                            btnText: "重置",
                            display: "inline",
                            icon: "el-icon-refresh",
                            size: "mini",
                            onClick: {
                                type: "js",
                                expression: `function(){
                            field.restForm()
                        }`
                            }
                        },
                    ]
                },
            ]
        },
        {
            component: "Input",
            label: "数据号",
            display: "inline",
            name: "dataNo",
            type: "number",
            unit: "km",
            clearable: false,
            onChange: {
                type: "js",
                expression: `
                            function(value){
                                console.log(value)
                            }
                        `
            }
        },
        {
            component: "Button",
            btnText: "查询",
            display: "inline",
            type: "primary",
            icon: "el-icon-search",
            size: "mini",
            onClick: {
                type: "js",
                expression: `function(){
                            return field.getValues().then(values=>{
                                return values && _searchFormSubmit(values)
                            })
                        }`
            }
        },
        {
            component: "Button",
            btnText: "重置",
            display: "inline",
            icon: "el-icon-refresh",
            size: "mini",
            onClick: {
                type: "js",
                expression: `function(){
                            field.restForm()
                        }`
            }
        },



    ]
}